        let inp = $('.user input')      
        let bnt = $('.sub>input')[0]
        bnt.onclick = function (){
            let list = JSON.parse(localStorage.getItem('user'))
            let user = inp[0].value
            let pas = inp[1].value
            let users = $('.user')
            let res = /^(?=.*\d)(?=.*[A-z])[\da-zA-Z]{1,9}$/
            let ress = /^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$/
            let re = /^1\d{10}$/
            if(user == ''&& pas == '' ){
                alert('账户密码不能为空')
                return
            }
            if(!(re.test(user)||ress.test(user))){
                 alert( '账号不格式不正确')
                 return
                
            }
            // if(user == ''&& pas == '' ){
            //     alert('不能为空')
            //     return
            // }
            for (const key in list) {
                if(key == user){
                    if(list[key] == pas){
                        location.href = '../index.html'
                    }else{
                        alert('账户或密码错误')
                        inp[1].value = ''
                    }
                }else{
                   if(confirm('该账号没有注册,是否前往注册？')){
                        location.href = '../html/register.html'
                   }
                }
            }
        }